import request from '@/utils/request'
import type { loginData } from './type'

enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
}

export const Login = (
  username: string,
  password: string,
): Promise<loginData> => {
  return request({
    url: API.LOGIN_URL,
    method: 'post',
    data: {
      username,
      password,
    },
  })
}
